using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace SailHero.Soft.FrameWork.Models.Mapping.AUTHCODEDBORA
{
    public class SYS_ROLEMap : EntityTypeConfiguration<SYS_ROLE>
    {
        public SYS_ROLEMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ROLEID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.ROLENAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.REMARK)
                .HasMaxLength(100);

            this.Property(t => t.CREATOR)
                .HasMaxLength(50);

            this.Property(t => t.UPDATEUSER)
                .HasMaxLength(50);

            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("SYS_ROLE", "LYHADMIN");
            this.Property(t => t.ROLEID).HasColumnName("ROLEID");
            this.Property(t => t.ROLENAME).HasColumnName("ROLENAME");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
            this.Property(t => t.CREATOR).HasColumnName("CREATOR");
            this.Property(t => t.CREATETIME).HasColumnName("CREATETIME");
            this.Property(t => t.UPDATEUSER).HasColumnName("UPDATEUSER");
            this.Property(t => t.UPDATETIME).HasColumnName("UPDATETIME");
            this.Property(t => t.ID).HasColumnName("ID");
        }
    }
}
